Skip to main content

Measures

You can obtain all the details you need for the measures in a specified catalog.

Request

A query for measures must include the following:

  • The SELECT statement must start with one or more measure parameters (comma separated).
  • After the parameters you must provide the following data source: FROM $system.MDSCHEMA_MEASURES
  • The name of the published catalog (AtScale project) for which you need measure information must be specified in the Properties > PropertyList > Catalog element. For details on obtaining a catalog name, see Catalogs.

You can request the following measure parameters:

  • CATALOG_NAME
  • COLUMN_DATA_TYPE
  • COLUMN_NAME
  • CUBE_GUID
  • CUBE_NAME
  • DATASET_NAME
  • DATA_TYPE
  • DEFAULT_FORMAT_STRING
  • DESCRIPTION
  • EXPRESSION
  • IS_METRICAL_ATTRIBUTE
  • MEASUREGROUP_NAME
  • MEASURE_AGGREGATOR
  • MEASURE_CAPTION
  • MEASURE_DISPLAY_FOLDER
  • MEASURE_GUID
  • MEASURE_IS_VISIBLE
  • MEASURE_NAME
  • MEASURE_NAME_SQL_COLUMN_NAME
  • MEASURE_UNIQUE_NAME
  • MEASURE_UNQUALIFIED_CAPTION
  • NUMERIC_PRECISION
  • NUMERIC_SCALE
  • PARENT_LEVEL_ID
  • PARENT_LEVEL_NAME

For details about the parameter types, see the xsd:schema element in the sample response provided below.

Response

The response contains a <row> element for each measure in the specified catalog. Each of these elements contains the values of the requested parameters.

Sample request

The example here shows how to make a request with the curl tool:

  • The requested data are the name (MEASURE_NAME), data type (DATA_TYPE), and expression (EXPRESSION) of the measure.
  • The request is for the measures in the Sales Insights catalog.
  • The token is obtained in advance.
  • The query is for the default organization.
  • The address of the AtScale system is: http://example.com:10502/xmla/default

The XML part of the request is as follows:

<?xml version="1.0"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
<Command>
<Statement>SELECT MEASURE_NAME, DATA_TYPE, EXPRESSION FROM $system.MDSCHEMA_MEASURES</Statement>
</Command>
<Properties>
<PropertyList>
<Catalog>Sales Insights</Catalog>
</PropertyList>
</Properties>
</Execute>
</Body>
</Envelope>

Here is the full form of the curl request:

curl -X POST \
-H "Authorization:Bearer $token" -H 'Content-Type: application/xml' \
-d '<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">\
<Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis">\
<Command>\
<Statement>SELECT MEASURE_NAME, DATA_TYPE, EXPRESSION FROM $system.MDSCHEMA_MEASURES</Statement>\
</Command>\
<Properties><PropertyList>\
<Catalog>Sales Insights</Catalog>
</PropertyList></Properties>\
</Execute></Body></Envelope>' \
http://example.com:10502/xmla/default

Sample response

The response for the sample request above contains <row> elements for each measure found. As requested, each of these elements contains only name, data type, and expression of the measure:

<row>
<MEASURE_NAME>List Price</MEASURE_NAME>
<DATA_TYPE>4</DATA_TYPE>
<EXPRESSION/>
</row>
<row>
<MEASURE_NAME>MinOrderDate</MEASURE_NAME>
<DATA_TYPE>3</DATA_TYPE>
<EXPRESSION/>
</row>
<row>
<MEASURE_NAME>Average Customer Count per Order</MEASURE_NAME>
<DATA_TYPE>5</DATA_TYPE>
<EXPRESSION>([Measures].[customercount1] / [Measures].[orderquantity1])</EXPRESSION>
</row>

Here is the full response:

<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<as:queryId xmlns:as="http://xsd.atscale.com/soap_v1" soap:mustUnderstand="0">9c5ec773-cf86-499f-b31b-ede43375b5ff</as:queryId>
</soap:Header>
<soap:Body>
<ExecuteResponse xmlns="urn:schemas-microsoft-com:xml-analysis">
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:msxmla="http://schemas.microsoft.com/analysisservices/2003/xmla" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsd:schema xmlns:sql="urn:schemas-microsoft-com:xml-sql" targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset" elementFormDefault="qualified">
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="row" type="row"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="uuid">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="xmlDocument">
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="row">
<xsd:sequence>
<xsd:element sql:field="MEASURE_NAME" name="MEASURE_NAME" type="xsd:string" minOccurs="0"/>
<xsd:element sql:field="DATA_TYPE" name="DATA_TYPE" type="xsd:unsignedShort" minOccurs="0"/>
<xsd:element sql:field="EXPRESSION" name="EXPRESSION" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<row>
<MEASURE_NAME>List Price</MEASURE_NAME>
<DATA_TYPE>4</DATA_TYPE>
<EXPRESSION/>
</row>
<row>
<MEASURE_NAME>MinOrderDate</MEASURE_NAME>
<DATA_TYPE>3</DATA_TYPE>
<EXPRESSION/>
</row>
<row>
<MEASURE_NAME>Average Customer Count per Order</MEASURE_NAME>
<DATA_TYPE>5</DATA_TYPE>
<EXPRESSION>([Measures].[customercount1] / [Measures].[orderquantity1])</EXPRESSION>
</row>
</root>
</return>
</ExecuteResponse>
</soap:Body>
</soap:Envelope>

More information